//防抖函数
function _debounce(fn, delay) {
  let timer;
  return function () {
    let context = this,
      arg = arguments;
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
    timer = setTimeout(() => {
      return fn.apply(context, arg);
    }, delay);
  };
}
export default _debounce;
